#ifndef __IOPORT_H__
#define __IOPORT_H__

#include "linux/types.h"

struct resource
{
    resource_size_t start;
    resource_size_t end;
    char *name;
    unsigned long flags;
    unsigned long desc;
    struct resource *parent, *sibling, *child;
};

#define IORESOURCE_BITS		0x000000ff	/* Bus-specific bits */

#define IORESOURCE_TYPE_BITS	0x00001f00	/* Resource type */
#define IORESOURCE_IO		0x00000100	/* PCI/ISA I/O ports */
#define IORESOURCE_MEM		0x00000200
#define IORESOURCE_REG		0x00000300	/* Register offsets */
#define IORESOURCE_IRQ		0x00000400
#define IORESOURCE_DMA		0x00000800
#define IORESOURCE_BUS		0x00001000

static inline int resource_size( struct resource *res)
{
    return (int)(res->end - res->start + 1);
}

#endif
